#include <stdio.h>
#include "binarySearchTree.h"
#define BUFFER_SIZE 5
int comparaBasicDataFunc(void *arg1, void *arg2)
{
    int val1 = *(int *)arg1;
    int val2 = *(int *)arg2;
    return val1 - val2;
}
int printBasicData(void *arg)
{
    int ret = 0;
    int val = *(int *)arg;
    printf("val=%d\n", val);
}
int main()
{
    BinarySearchTree *BST;
    binarySearchTreeInit(&BST, comparaBasicDataFunc, printBasicData);
    int buffer[BUFFER_SIZE] = {56, 28, 75, 73, 77};
    for (int idx = 0; idx < BUFFER_SIZE; idx++)
    {
        binarySearchTreeInsertVal(BST, &buffer[idx]);
    }
    int height = 0;
    binarySearchTreeGetHeight(BST, &height);

    /*中序遍历*/
    binarySearchTreeInOrderTravel(BST, BST->root);
    printf("\n");

    /*层次遍历*/
    binarySearchTreeLevelOrderTravel(BST);
    printf("\n");

    return 0;
}